package com.sharemarking.wa.platform.controller;

import com.sharemarking.wa.common.ResponseParams;
import com.sharemarking.wa.platform.service.IndexService;
import com.sharemarking.wa.platform.service.ManageWasteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dxy
 */
@RestController
@RequestMapping(value = "index")
public class IndexController {
    @Autowired
    IndexService indexService;
    @Autowired
    ManageWasteService manageWasteService;

    /**
     * 获取首页信息
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "getList")
    public ResponseParams<?> getList() throws Exception {
        return indexService.getList();
    }



    /**
     * 获取经营单位信息
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "getOrgInfo")
    public ResponseParams<?> getOrgInfo() throws Exception {
        return indexService.getOrgInfo();
    }


    /**
     * 获取废品详情
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "getWasteInfo")
    public ResponseParams<?> getWasteInfo() throws Exception {
        return indexService.getWasteInfo();
    }


    /**
     * 搜索
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "search")
    public ResponseParams<?> search() throws Exception {
        return indexService.search();
    }


    /**
     * 获取搜索关键字列表
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "getSearchKeyList")
    public ResponseParams<?> getSearchKeyList() throws Exception {
        return indexService.getSearchKeyList();
    }

    /**
     * 获取首页信息（游客模式）
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "getVisitorList")
    public ResponseParams<?> getVisitorList() throws Exception {
        return indexService.getVisitorList();
    }

    /**
     * 删除历史搜索
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "deleteSearch")
    public ResponseParams<?> deleteSearch() throws Exception {
        return indexService.deleteSearch();
    }

    /**
     * @Description: 获取废品类别详情
     * @Param:
     * @return:
     */
    @RequestMapping(value = "getWasteTypeInfo")
    public ResponseParams<?> getWasteTypeInfo() throws Exception{
        return manageWasteService.getWasteTypeInfo();
    }
}
